import request from '@/utils/request';
import { TableListParams } from './data';

export async function queryRule(params?: Object) {
  return request('/api/sms/coupon/list', {
    method: 'GET',
    params,
  });
}

export async function removeRule(data: { key: number[] }) {
  return request(`/api/sms/coupon/list/${data.key.toString()}`, {
    method: 'DELETE',
    // data,
  });
}

export async function addRule(data: object) {
  return request('/api/sms/coupon/list', {
    method: 'POST',
    data,
  });
}

export async function updateRule(id: number, data: TableListParams) {
  return request(`/api/sms/coupon/list/${id}`, {
    method: 'PUT',
    data,
  });
}
